package com.lagou.niancheng.lagou.service.common;

/**
 * com.lagou.niancheng.lagouserviceuser.common.LagouException
 *
 * @author 大犬
 * @date 2020/6/28
 */
public class LagouException extends RuntimeException {
    private String errorCode;
    private String errorMsg;
    private Object[] params;


    public LagouException(ErrorCode errorCode) {
        this.errorCode = errorCode.getErrorCode();
        this.errorMsg = errorCode.getErrorMsg();
    }

    public LagouException(ErrorCode errorCode, Object... params) {
        this(errorCode);
        this.params = params;
    }

    public LagouException(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public Object[] getParams() {
        return params;
    }
}
